import java.util.Scanner;

public class 组合型 {
    static int m;
    static int n;

    static int[] arr = new int[30];
    static int start;



    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        dfs(1,1);
    }
    private static void dfs(int u, int start) {
        if(u+n-start < m) return;
        if(u>m) {
            for(int i=1; i<=m; i++) {
                System.out.print(arr[i] + " ");
            }
            System.out.println();
            return ;
        }
        for(int i = start;i<=n;i++) {
            arr[u] = i;
            dfs(u+1,i+1);

            arr[u] = 0;
        }


    }
}
